# encoding: utf-8
# @Author: zsl
# @Time  : 2024/10/20 22:32
# @Desc :

# 使用sort()方法对列表进行永久排序
# cars = ['bmw', 'audi', 'toyata', 'subaru']
# cars.sort(reverse=True)
# print(cars)

# 使用sorted()函数对列表进行临时排序
# cars = ['bmw', 'audi', 'toyata', 'subaru']
# print("Here is the original list:")
# print(cars)
#
# print("\nHere is the sorted list:")
# print(sorted(cars, reverse=True))
#
# print("\nHere is the original list again:")
# print(cars)

# 反向打印列表
cars = ['bmw', 'audi', 'toyata', 'subaru']
print(cars)

cars.reverse()
print(cars)

# 确定列表的⻓度
print(len(cars))
